<?php // Do not delete these lines
	if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
		die ('Please do not load this page directly. Thanks!');

        if (!empty($post->post_password)) { // if there's a password
            if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) {  // and it doesn't match the cookie
				?>

				<p class="nocomments">This post is password protected. Enter the password to view comments.<p>

				<?php
				return;
            }
        }

		/* This variable is for alternating comment background */
		$oddcomment = 'alt';
		$commentnumber = 0;
		
		if( $post->comment_status == 'open' || $comments ) { 
		?>
			<h1 id="comments"><?php comments_number('No responses', 'One Response', '% Responses' );?> to &#8220;<?php the_title(); ?>&#8221;</h1>
		<?php 
		}
		
		if( $comments ){ 
		?>
			<ol id="commentlist">
		<?php 
		foreach( $comments as $comment ){
			$commentnumber++;
			$isByAuthor = ($comment->comment_author_email == 'sabmann@gmail.com');
		?>	
			<li class="<?php if($isByAuthor){ echo 'admin '; } echo $oddcomment; ?>" id="comment-<?php comment_ID() ?>">
				<div class="wrapper">
					<div class="meta">
						<b>
						<?php if ((($comment->comment_type == 'trackback') || ($comment->comment_type == 'pingback')) && strlen($comment->comment_author) > 18) {
				        	echo '<a href="'.$comment->comment_author_url.'" title="Trackback/Pingback">'.substr($comment->comment_author,0,18).'...</a>';
				        }else{
				        	comment_author_link();
				        }?></b><br />
				         <?php if (function_exists('time_since')) {
				            echo time_since(abs(strtotime($comment->comment_date_gmt . " GMT")), time()) . " ago";
				          } else {
				            the_time('H:i - F jS, Y');
				          } edit_comment_link('edit',' - ','');
				        ?> 
					</div>
					<div class="text"><?php comment_text() ?></div>
				</div>
			</li>
	
		<?php 
			$oddcomment = ( $oddcomment == 'alt' ) ? '' : 'alt';			
		}
		
		if( $post->comment_status == 'open' ) { 
		?>
			<li class="<?php echo $oddcomment; ?> preview" id="comment-x">
				<div class="wrapper">
					<div class="meta">
						<a id="author-preview" href="http://">Name</a><br />
				        some time ago
					</div>
					<div class="text" id="comment-preview">This is a preview.</div>
				</div>
			</li>
		<?php 
		}
		?>
		</ol>

		<?php 
		}
		if( $post->comment_status == 'open' ){		
		}else{
		?>
			<div style="padding: 15px 0px">
				<h2>Comments are closed.</h2>
			</div>
		<?php		
		} 
		
		if ($post->comment_status == 'open'){ 
		?>
		<h2>Leave a reply</h2>
		
		<?php if ( get_option('comment_registration') && !$user_ID ){ ?>
		<p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>">logged in</a> to post a comment.</p>
		<?php }else{ ?>
		
		<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
		
		<?php if( $user_ID ){ ?>
		
		<p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="Log out of this account">Logout &raquo;</a></p>
		
		<?php }else{ ?>
		
		<table>
			<tbody>
				<tr>
					<td class="inputtd"><span><input id="author" name="author" value="<?php _e(($comment_author) ? $comment_author : 'Name'); ?>" maxlength="20" type="text" onfocus="javascript:if(this.value == 'Name'){ this.value = '';}" onblur="javascript:if(this.value == '') {this.value = 'Name'; }" tabindex="1" /></span></td>
					<?php if ($req){ ?><td class="required"><small >*</small></td><?php } ?>
				</tr>
				<tr>
					<td class="inputtd"><span><input id="email" name="email" value="<?php _e(( $comment_author_email) ?  $comment_author_email : 'Email'); ?>" maxlength="50" type="text" onfocus="javascript:if(this.value == 'Email'){ this.value = '';}" onblur="javascript:if(this.value == '') {this.value = 'Email'; }" tabindex="2" /></span></td>
					<?php if ($req){ ?><td class="required"><small >* (Will not be published)</small></td><?php } ?>
				</tr>
				<tr>
					<td class="inputtd"><span><input id="url" name="url" value="<?php _e(($comment_author_url) ? $comment_author_url : 'http://'); ?>" tabindex="3" /></span></td>
				</tr>
			</tbody>
		</table>
		<?php } ?>
		
		<table>
			<tbody>
			<tr>
				<td><small><strong>XHTML:</strong> You can use these tags: <?php echo allowed_tags(); ?>. For code use '&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;&lt;/code&gt;&lt;/pre&gt;'.</small></td>
			</tr>
			<tr>
				<td class="textArea"><span><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></span></td>
			</tr>
		
			</tbody>
		</table>
		
		<p>
		<input type="submit" id="submit" name="submit" value="Submit" />
		</p>
		<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
		<?php do_action('comment_form', $post->ID); ?>
		<div class="gototop"><a href="#top">Go to top</a></div>	
		</form>
		<div class="clear"></div>
		<?php } ?>
		<?php } ?>